import http from '@/utils/http'

const BASE_URL = '/task/logUser'

export interface LogUserResp {
  logId: string
  userId: string
  createUserString: string
  updateUserString: string
}
export interface LogUserDetailResp {
  logId: string
  userId: string
  createUserString: string
  updateUserString: string
}
export interface LogUserQuery {
  logId: string
  userId: string
  sort: Array<string>
}
export interface LogUserPageQuery extends LogUserQuery, PageQuery {}

/** @desc 查询试验工作量和工作人员关联列表 */
export function listLogUser(query: LogUserPageQuery) {
  return http.get<PageRes<LogUserResp[]>>(`${BASE_URL}`, query)
}

/** @desc 查询试验工作量和工作人员关联详情 */
export function getLogUser(id: string) {
  return http.get<LogUserDetailResp>(`${BASE_URL}/${id}`)
}

/** @desc 新增试验工作量和工作人员关联 */
export function addLogUser(data: any) {
  return http.post(`${BASE_URL}`, data)
}

/** @desc 修改试验工作量和工作人员关联 */
export function updateLogUser(data: any, id: string) {
  return http.put(`${BASE_URL}/${id}`, data)
}

/** @desc 删除试验工作量和工作人员关联 */
export function deleteLogUser(id: string) {
  return http.del(`${BASE_URL}/${id}`)
}

/** @desc 导出试验工作量和工作人员关联 */
export function exportLogUser(query: LogUserQuery) {
  return http.download<any>(`${BASE_URL}/export`, query)
}
